package testGame;

/**
 * @author Cheung Oi Kwan 
 */

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import satirGame.Map;

public class MapTest {
	
	Map TestMap = new Map(60,60,60);

	@Before
	public void setUp() throws Exception {
	}
	
	//yung's 
	/*@Test
	public void testSetGrayGrid(){
		int direction = 0;
		int xPos = 0;
		int yPos = 0;
		TestMap.setGrayGrid(xPos,yPos,direction);
		assertEquals(direction, TestMap.getGrayGridDirection(xPos,yPos));
	}*/
	
	@Test //curJ > curPosX, curI < curPosY
	public void testGrayGridIs1(){
		int curJ = 5;
		int curI =2;
		int curPosX = 3;
		int curPosY = 3;
		boolean result = true;
		assertEquals(result, TestMap.setGrayGrid(curJ, curI, curPosX, curPosY));			
	}
	
	@Test //curJ < curPosX, curI < curPosY
	public void testGrayGridIs3(){
		int curJ = 6;
		int curI =4;
		int curPosX = 8;
		int curPosY = 5;
		boolean result = true;
		assertEquals(result, TestMap.setGrayGrid(curJ, curI, curPosX, curPosY));			
	}
	
	@Test // curJ < curPosX, curI > curPosY
	public void testGrayGridIs5(){
		int curJ = 3;
		int curI = 7;
		int curPosX = 5;
		int curPosY = 4;
		boolean result = false;
		assertEquals(result, TestMap.setGrayGrid(curJ, curI, curPosX, curPosY));
	}
	
	@Test // curJ > curPosX, curI > curPosY
	public void testGrayGridIs6(){
		int curJ = 4;
		int curI = 5;
		int curPosX = 1;
		int curPosY = 2;
		boolean result = false;
		assertEquals(result, TestMap.setGrayGrid(curJ, curI, curPosX, curPosY));
	}
	
}


/*----------------Version detail----------------------------

Modified time: 17:38_16/03/2012

Editor: Cheung Oi Kwan

Content: 

Add all test cases
-----------------------------------------------------------*/